<?php

/**
 * Modules form.
 *
 * @package    espace14
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ModulesForm extends BaseModulesForm
{
  public function configure()
  {
	$this->setWidgets(array(
	  'id'          => new sfWidgetFormInputHidden(),
      'nom'         => new sfWidgetFormInputText(),
      'date_debut'  => new sfWidgetFormTextarea(),
      'date_fin'    => new sfWidgetFormTextarea(),
      'tarif'       => new sfWidgetFormInputText(),
      'description' => new sfWidgetFormInputHidden(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'nom'         => new sfValidatorString(array('max_length' => 500, 'required' => false)),
      'date_debut'  => new sfValidatorString(array('max_length' => 500, 'required' => false)),
      'date_fin'    => new sfValidatorString(array('max_length' => 500, 'required' => false)),
      'tarif'       => new sfValidatorString(array('max_length' => 500, 'required' => false)),
      'description' => new sfValidatorString(array('max_length' => 3000, 'required' => false)),
    ));
	
	$this->widgetSchema->setNameFormat('modules[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::configure();
  }
}
